testsuite/gtk/[flatten|sort]listmodel.c: Avoid VLA usage
authorChun-wei Fan <fanc999@yahoo.com.tw>
Tue, 9 Oct 2018 08:22:28 +0000 (16:22 +0800)
committerChun-wei Fan <fanc999@yahoo.com.tw>
Tue, 9 Oct 2018 08:26:21 +0000 (16:26 +0800)
Visual Studio is unlikely to support VLAs at any point, so avoid using
them and use g_newa() instead.

testsuite/gtk/flattenlistmodel.c
testsuite/gtk/sortlistmodel.c

index f522f1e12182ba3b611a8c07d9bbbbcc833e358d..c06e30b3509d6fee991a73225230e14b1e837f09 100644 (file)
@@ -61,7 +61,7 @@ splice (GListStore *store,
         guint      *numbers,
         guint       added)
 {
-  GObject *objects[added];
+  GObject **objects = g_newa (GObject *, added);
   guint i;
 
   for (i = 0; i < added; i++)
index 31a6711f04fccbc82bde31ab4795dcd426cd0513..1b54d0b9762181abbb53b48ffee0dcf8b70d0147 100644 (file)
@@ -56,7 +56,7 @@ splice (GListStore *store,
         guint      *numbers,
         guint       added)
 {
-  GObject *objects[added];
+  GObject **objects = g_newa (GObject *, added);
   guint i;
 
   for (i = 0; i < added; i++)